﻿using UnityEngine;
using System;
using System.Collections;
using Hont.C2UTool;

public class C2UStaticInfoCapsuleColliderSyncer : MonoBehaviour, IC2UStaticInfoReceiver
{
    public bool isTrigger;
    public Vector3 center;
    public float radius;
    public float height;
    public int direction;


    public void OnStaticInfoReplaced(GameObject root)
    {
    }

    public void OnStaticInfoReplacedLate(GameObject root)
    {
        var capsuleCollider = gameObject.AddComponent<CapsuleCollider>();

        capsuleCollider.isTrigger = isTrigger;
        capsuleCollider.direction = direction;
        capsuleCollider.height = height;
        capsuleCollider.radius = radius;

        DestroyImmediate(this);
    }
}
